import request from "../utils/request";

//挖矿详情
export function defiOreDetails(id) {
  return request({
    url: `/v1/active/defiOreDetails/${id}`,
    method: "GET",
  });
}

//取消挖矿
export function cancelDefiOre(id) {
  return request({
    url: `/v1/userActiveDefi/cancel/${id}`,
    method: "POST",
  });
}

//Defi挖矿列表
export function defiOrePage(params) {
  return request({
    url: "/v1/active/defiOrePage",
    method: "GET",
    params: params,
  });
}

//理财机器人托管状态
export function userWealthManagementRobotStatus() {
  return request({
    url: "/v1/userInfo/userWealthManagementRobotStatus",
    method: "GET",
  });
}

//理财宝详情
export function wealthManagementDetails(id) {
  return request({
    url: `/v1/active/wealthManagementDetails/${id}`,
    method: "GET",
  });
}

//取消理财
export function cancelWealthManagement(id) {
  return request({
    url: `/v1/userWealthManagement/cancel/${id}`,
    method: "POST",
  });
}

//理财宝列表
export function wealthManagementPage(params) {
  return request({
    url: "/v1/active/wealthManagementPage",
    method: "GET",
    params,
  });
}

//购买理财宝
export function activeWealthBuy(data) {
  return request({
    url: "/v1/userWealthManagement/activeWealthBuy",
    method: "POST",
    data,
  });
}

//我的理财宝详情
export function userWealthManagement(id) {
  return request({
    url: `/v1/userWealthManagement/details/${id}`,
    method: "GET",
  });
}

//我的理财列表
export function userWealthManagementPage(params) {
  return request({
    url: "/v1/userWealthManagement/page",
    method: "GET",
    params,
  });
}

// 立即挖矿
export function userActiveDefi(data) {
  return request({
    url: "/v1/userActiveDefi/defiOre",
    method: "POST",
    data,
  });
}

//我的挖矿详情
export function userWealthManagementDetail(id) {
  return request({
    url: `/v1/userActiveDefi/details/${id}`,
    method: "GET",
  });
}

//理财账户余额信息
export function getWalletFinancialInfo(params) {
  return request({
    url: "/v1/userActiveDefi/getWalletFinancialInfo",
    method: "GET",
    params,
  });
}

//我的挖矿列表
export function userActiveDefiPage(params) {
  return request({
    url: "/v1/userActiveDefi/page",
    method: "GET",
    params,
  });
}

//新股申购详情
export function stockSubscriptionDetail(id) {
  return request({
    url: `/v1/stockSubscription/details/${id}`,
    method: "GET",
  });
}

//新股申购记录
export function stockSubscriptionRecord(params) {
  return request({
    url: "/v1/stockSubscription/orderPage",
    method: "GET",
    params,
  });
}

//新股申购列表
export function stockSubscriptionList(params) {
  return request({
    url: "/v1/stockSubscription/page",
    method: "GET",
    params,
  });
}

//新股申购
export function stockSubscriptionSubscription(params) {
  return request({
    url: "/v1/stockSubscription/subscription",
    method: "POST",
    data: params,
  });
}
//新币申购详情
export function currencySubscriptionDetail(id) {
  return request({
    url: `/v1/currencySubscription/details/${id}`,
    method: "GET",
  });
}

//新币申购记录
export function currencySubscriptionRecord(params) {
  return request({
    url: "/v1/currencySubscription/orderPage",
    method: "GET",
    params,
  });
}

//新币申购列表
export function currencySubscriptionList(params) {
  return request({
    url: "/v1/currencySubscription/page",
    method: "GET",
    params,
  });
}

//申购
export function currencySubscriptionSubscription(params) {
  return request({
    url: "/v1/currencySubscription/subscription",
    method: "POST",
    data: params,
  });
}
